<extend name="Public/base"/>
<block name="body">
	<div class="am-container" >

        <div class="am-g">
			{:ad(3,'article_detail_top')}
		</div>
			<!-- 面包屑 -->
		<div class="am-g" style="margin-top:10px;">
			<ol class="am-breadcrumb">
			  <li><a href="{:U('Index/index')}">{:C('WEB_SITE_TITLE')}</a></li>
			  <li><a href="{:U('Article/index',array('category'=>$category['id']))}">{$category['title']}</a></li>
			  <li class="am-active"> {$info['title']}   </li>
			</ol>
        </div>
        <div class="am-g">
			<div class="am-u-md-8">
				<div class="am-article article-detail">
					<div class="am-article-hd" >
							<div class="am-article-title">{$info.title}</div>
							<div class="am-article-meta">
									<span class="col-md-6">{$info.create_time|date='Y-m-d H:i:s',###}</span>
								<span class="col-md-6">
								<i class="am-icon-eye"></i>
										{$info.view}
								</span>
							</div>

					</div>

					<div class="am-article-bd">
						<div class="am-article-lead">
							{$info.description}
						</div>
						<div class="cover">
							<img class="am-img-responsive" src="{$info.cover_id|get_cover=path}" alt="{$info.title}">
						</div>
						{:get_tag_url($info['id'],$info['content'])}
					</div>
					<div class="post-info" data-tag="share_1">
						<ul class="am-list">
							<li class="info-item">
								<i class="am-icon-eye"></i>
								<span>{$info.view}</span>
							</li>
							<li class="info-item">
								<i class="am-icon-heart-o" data-id="{$info.id}"></i>
								<span>{$info.favor}</span>
							</li>
							<li class="info-item">
								<i class="am-icon-comment-o"></i>
								<span>{$info.comment}</span>
							</li>
							<li class="info-item">
								<i class="am-icon-share"></i>
								<span>{$info.share_count}</span>
							</li>

						</ul>
						<div class="ke-shares" >
							<span>分享到</span>
							<a class="share-icon share-icon-weixin" href="{:U('Share/share',array('share_id'=>'weixin','type'=>'article','id'=>$info['id']));}" target="_blank"></a>
							<a class="share-icon share-icon-qzone" href="{:U('Share/share',array('share_id'=>'qzone','type'=>'article','id'=>$info['id']));}" target="_blank"></a>
							<a class="share-icon share-icon-tsina" href="{:U('Share/share',array('share_id'=>'tsina','type'=>'article','id'=>$info['id']));}" target="_blank"></a>
							<a class="share-icon share-icon-sqq" href="{:U('Share/share',array('share_id'=>'cqq','type'=>'article','id'=>$info['id']));}" target="_blank"></a>
						</div>
						{:hook('documentDetailAfter',$info)}
					</div>
						<div class="col-md-12">
							<notempty name="info.tag">
								<p class="tags">
									<em>继续阅读：</em>
									<volist name="info.tag" id="vo">
										<a class="content_tag label label-info" href="{:U('Article/tag',array('id'=>$vo['id']))}">{$vo.tag_name}</a>
									</volist>
								</p>
							</notempty>
						</div>
						<div class="comment">
							<h5>评论</h5>
							<article class="am-comment"> <!-- 评论容器 -->


								<ul class="am-comments-list am-comments-list-flip">
									<volist name="comment_list" id="vo">
										<li class="am-comment am-comment-warning">
											<a href="#link-to-user-home">
												<notempty name="vo.avatar">
													<img alt="{$vo.nickname}" src="{$vo.avatar}" class="am-comment-avatar" height="48" width="48">
													<else/>
													<img alt="{$vo.nickname}" src="__IMG__/headicon_128.png" class="am-comment-avatar" height="48" width="48">
												</notempty>
											</a>
											<div class="am-comment-main">
												<header class="am-comment-hd">
													<div class="am-comment-meta">
														<a href="#link-to-user" class="am-comment-author">{$vo.nickname}</a>
														评论于
														<time datetime="{$vo.create_time|date='Y-m-d H:i:s',###}" title="{$vo.create_time|date='Y-m-d H:i:s',###}">{$vo.create_time|date='Y-m-d H:i:s',###}</time>
													</div>
												</header>
												<div class="am-comment-bd">
													<p>
														{$vo.content}
													</p>
												</div>
											</div>
										</li>
									</volist>
								</ul>
							</article>
						</div>

						<div class="col-md-10 col-md-offset-2 ">
							<form class="am-form" action="{:U('Article/comment')}">
								<fieldset>
								<div class="am-form-group">
									<textarea class="" rows="3"  name="content"></textarea>
								</div>

								<input type="hidden" name="object_id" value="{$info['id']}">
								<button class="ajax-post am-btn am-btn-success am-fl" style="margin-top:20px;" type="submit" target-form="am-form">提交评论</button>
								</fieldset>
							</form>
						</div>


					</div>
				</div>

			<div class="am-u-md-4">
                <div data-am-widget="list_news" class="am-list-news am-list-news-default" >
                    <div class="am-list-news-hd am-cf">
                        <a href="###" class="">
                            <h2>推荐文章</h2>
                        </a>
                    </div>
                    <div class="am-list-news-bd">
                        <ul class="am-list">
                            <volist name="recommend_article['detail']" id="list">
                                <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left">
                                    <div class="am-u-sm-4 am-list-thumb">
                                        <a href="{:U('Article/detail?id='.$list['id'])}" class="">
                                            <img src="{$list.cover_id|get_cover=path}" alt="{$list.title}"/>
                                        </a>
                                    </div>

                                    <div class=" am-u-sm-8 am-list-main">
                                        <h3 class="am-list-item-hd"><a href="{:U('Article/detail?id='.$list['id'])}" class="">{$list.title}</a></h3>

                                        <div class="am-list-item-text">{$list.description}</div>

                                    </div>
                                </li>
                            </volist>
                        </ul>
                    </div>

                </div>
				<div data-am-widget="list_news" class="am-list-news am-list-news-default" >
					<div class="am-list-news-hd am-cf">
						<a href="###" class="">
							<h2>最近更新</h2>
						</a>
					</div>
					<div class="am-list-news-bd">
						<ul class="am-list">
							<volist name="news" id="list">
								<li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left">
									<div class="am-u-sm-4 am-list-thumb">
										<a href="{:U('Article/detail?id='.$list['id'])}" class="">
											<img src="{$list.cover_id|get_cover=path}" alt="{$list.title}"/>
										</a>
									</div>

									<div class=" am-u-sm-8 am-list-main">
										<h3 class="am-list-item-hd"><a href="{:U('Article/detail?id='.$list['id'])}" class="">{$list.title}</a></h3>

										<div class="am-list-item-text">{$list.description}</div>

									</div>
								</li>
							</volist>
						</ul>
					</div>

				</div>

			</div>
           
        </div>
    </div>

</block>
<block name="script">
	<script>
		showGoodsImgInArticle = "{:C('SHOW_GOODS_IMG_IN_ARTICLE')}";
		var img = '';
		var article = "{$info['id']}";
		$(function(){
			$('#contents').find('img').each(function(){
				$(this).addClass('img-responsive');
			});
			$('.article-goods').each(function(){
				var id = $(this).attr('name');
				var p  = $(this).parent();

				if(id!='' && id!='undefinded'){
					$.post("{:U('Goods/buttonInfo')}", {'id':id,'article':article}, function (result) {
						if(result.errno <=0){
							goods = result.content;
							var title = '<h3 class= "goods-title"><i class="am-icon-circle"></i>'+goods.name+'</h3>'
							if(showGoodsImgInArticle >0){
								img = '<img class="img-responsive goods-img" src="'+goods.src+'">';
							}
							var description ='<p class="goods-description">'+goods.description+'</p>';
							var div = title+description+img+'<div class="goods-other">'+'<span class="price">￥:'+goods.price+'</span>'+'<a class="goods-link" href="'+goods.url+'"><span>查看详细</span></a>'+'</div>';
							p.html(div);
							p.addClass('goods-extend');
						}else{
							p.remove();
						}
					},'json');
				}

			});
		});

	</script>
</block>

